package dr.branch.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import dr.branch.dao.BranchDAO;
import dr.controller.*;

public class DeleteAction extends ActionSupportLogin {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws Throwable {
		request.setCharacterEncoding("euc-kr");

		String id=getUserLoginId(request);// session
		
		//admin check
		if(id!="admin") return ADMINNULL_PATH;
		//admin check
		
		int b_code = Integer.parseInt(request.getParameter("b_code"));
		BranchDAO dbPro = BranchDAO.getInstance();
		dbPro.deleteBranch(b_code);
				
		return "/branch/deletePro.jsp";
	}

}
